% split channel data and save them onto the disk as separate files
% this will facilirate the processing later
% you can consider these as temporary data. they can be deleted safely. 

load c6;
s = c6;
n_onset = 1880200;
s6_5min = double(s(n_onset-30000 : n_onset+30000)');
s6_10min = double(s(n_onset-60000 : n_onset+60000)');
s6_15min = double(s(n_onset-90000 : n_onset+90000)');
s6_20min = double(s(n_onset-120000 : n_onset+120000)');
s6_30min = double(s(n_onset-180000 : n_onset+180000)');
s6_40min = double(s(n_onset-240000 : n_onset+240000)');
s6_50min = double(s(n_onset-300000 : n_onset+300000)');
s6_60min = double(s(n_onset-360000 : n_onset+360000)');
s6_90min = double(s(n_onset-540000 : n_onset+540000)');
s6_120min = double(s(n_onset-720000 : n_onset+720000)');
save s6_5min s6_5min;
save s6_10min s6_10min;
save s6_15min s6_15min;
save s6_20min s6_20min;
save s6_30min s6_30min;
save s6_40min s6_40min;
save s6_50min s6_50min;
save s6_60min s6_60min;
save s6_90min s6_90min;
save s6_120min s6_120min;

load c6;
s = c6;
n_onset = 1880200;
n_len = 30000;
n_start = n_onset-30000;
c6_pre0m_len5m = double(s(n_start : n_start+n_len)');
n_start = n_onset-60000;
c6_pre5m_len5m = double(s(n_start : n_start+n_len)');
n_start = n_onset-60000;
c6_pre10m_len5m = double(s(n_start : n_start+n_len)');
n_start = n_onset-90000;
c6_pre15m_len5m = double(s(n_start : n_start+n_len)');
n_start = n_onset-120000;
c6_pre20m_len5m = double(s(n_start : n_start+n_len)');

c6_pre30m_len5m = double(s(n_onset-180000 : n_onset+180000)');
c6_pre40m_len5m = double(s(n_onset-240000 : n_onset+240000)');
c6_pre50m_len5m = double(s(n_onset-300000 : n_onset+300000)');
n_start = n_onset-360000;
c6_pre60m_len5m = double(s(n_start : n_start+n_len)');
c6_pre90m_len5m = double(s(n_onset-540000 : n_onset+540000)');
c6_pre120m_len5m = double(s(n_onset-720000 : n_onset+720000)');

save c6_pre0m_len5m c6_pre0m_len5m
save c6_pre5m_len5m c6_pre5m_len5m
save c6_pre15m_len5m c6_pre15m_len5m
save c6_pre20m_len5m c6_pre20m_len5m
save c6_pre60m_len5m c6_pre60m_len5m

load c6_pre0m_len5m c6_pre0m_len5m
load c6_pre5m_len5m c6_pre5m_len5m
load c6_pre15m_len5m c6_pre15m_len5m
load c6_pre20m_len5m c6_pre20m_len5m
load c6_pre60m_len5m c6_pre60m_len5m

save c6_pre0m_len5m.txt c6_pre0m_len5m  -ASCII -DOUBLE
save c6_pre5m_len5m.txt c6_pre5m_len5m -ASCII -DOUBLE
save c6_pre15m_len5m.txt c6_pre15m_len5m -ASCII -DOUBLE
save c6_pre20m_len5m.txt c6_pre20m_len5m -ASCII -DOUBLE
save c6_pre60m_len5m.txt c6_pre60m_len5m -ASCII -DOUBLE

save s6_10min s6_10min;
save s6_15min s6_15min;
save s6_20min s6_20min;
save s6_30min s6_30min;
save s6_40min s6_40min;
save s6_50min s6_50min;
save s6_60min s6_60min;
save s6_90min s6_90min;
save s6_120min s6_120min;




